package com.sx.springbootshiro.loginUser;

import com.sx.springbootshiro.model.LoginUserVB;
import com.sx.springbootshiro.service.LoginUserService;
import com.sx.springbootshiro.service.impl.LoginUserServiceImpl;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.util.List;

@RunWith(SpringRunner.class)
@SpringBootTest
public class LoginUser {
    private Logger logger = LogManager.getLogger(LoginUser.class);

    @Autowired
    private LoginUserService loginUserService;

    @Test
    public void insertLoginUser(){
        LoginUserVB loginUserVB = new LoginUserVB();
        loginUserVB.setUser_name("dickGlobal");
        loginUserVB.setUser_nickname("武北北");
        loginUserVB.setUser_password("0");
        loginUserVB.setUser_phone("13313457653");
        loginUserVB.setCompany_name("北控三兴");
        loginUserVB.setOffice_number("7668297");

        boolean flag = loginUserService.insetLoginUserVB(loginUserVB);

        logger.debug(" 插入 === ：" + flag);
    }

    @Test
    public void selectUserInfo(){
        List<LoginUserVB> loginUserVBS = loginUserService.selectLoginUserVBSByUseful();
        logger.debug(loginUserVBS);
    }



}
